<?php

namespace CMBUBank\UBank\Response\TransManager;

use CMBUBank\Http\Response;
use CMBUBank\UBank\Response\UBankBaseResponse;

class TransManagerCloseSubunitResponse extends UBankBaseResponse
{
    protected $responseCode = ['ntdumdltz1'];

    /**
     * subCode 记账子单元编号
     * @var  $subCode
     */
    protected $subCode;

    /**
     * subProNo 流程实例号
     * @var  $subProNo
     */
    protected $subProNo;

    protected $isFinish;

    protected function format(): Response
    {
        return parent::formatLimit1();
    }

    public function checkFinish()
    {
        if (!in_array($this->requestStatus, ['FIN', 'BNK', 'NPD', 'NTE'])) {
            $this->isFinish = false;
            return;
        }

        if ($this->returnFlg != 'S') {
            $this->isFinish = false;
            return;
        }
        $this->isFinish = true;
    }

    public function resultInfo(): array
    {
        return $this->bussList;
    }

    public function getSubCode()
    {
        return $this->subCode;
    }

    public function getIsFinish()
    {
        return $this->isFinish;
    }

    public function getSubProNo()
    {
        return $this->subProNo;
    }


}